<template>
	<view class="common-list u-f animated fadeInLeft fast">
		<view class="common-list-l">
			<image :src="item.userpic" mode="widthFix" lazy-load></image>
		</view>
		<view class="common-list-r">
			<view>
				<view class="u-f-ac u-f-jsb ">
					<view class="u-f-ac">
						{{item.username}}
						<tag-sex-age :sex="item.sex" :age="item.age"></tag-sex-age>
					</view>
					<view class="icon iconfont icon-zengjia"  @tap="guanzhu">关注</view>
				</view>
				<view class="common-list-r-time">26天前</view>
			</view>
			<view >{{item.title}}</view>
			<view class="u-f-ajc">
				<!-- 图片 -->
				<view class="u-f-ajc" style="flex-direction: column;">
					
					<block v-for="(pic, index) in item.morepic" :key="index">
						<image :src="pic" mode="widthFix" 
						lazy-load 
						@tap="imgdetail(index)"
						style="margin-bottom: 20upx"
						></image>
					</block>
				</view>
				<!-- 视频 -->
				<template v-if="item.type === 'video'">
					<view class="icon iconfont icon-bofang index-list-play"></view>
					<view class="index-list-playinfo">{{item.playNum}}次播放 {{item.long}}</view>
				</template>
	
				<template v-if="item.type === 'share'">
					<view class="common-list-share u-f-ac">
						<image :src="item.titlepic" mode="widthFix" lazy-load></image>
						<view class="">
							{{item.title}}
						</view>
					</view>
				</template>
	
			</view>
			<view class="u-f-ac u-f-jsb">
				<view>{{item.path}}</view>
				<view class="u-f-ac">
					<view class="icon iconfont icon-zhuanfa">{{item.shareNum}}</view>
					<view class="icon iconfont icon-pinglun1">{{item.commentNum}}</view>
					<view class="icon iconfont icon-dianzan1">{{item.commentNum}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import tagSexAge from '../common/tag-sex-age.vue';
	export default {
		components:{
			tagSexAge
		},
		props:{
			item:Object
		},
		methods:{
			//关注
			guanzhu(){
				this.item.isguanzhu = true;
				uni.showToast({
					title:"关注成功",
					icon:"success"
				});
			},
			imgdetail(index){
				console.log("imgIndex:",index);
				uni.previewImage({
					urls: this.item.morepic,
					current: index
				})
			}
		}
	}
</script>

<style scoped>
@import "../../common/list.css";
.common-list-r {
	border-bottom: 0;
}

.common-list {
	border-bottom: 1upx solid #EEEEEE;
}

.common-list-r-time {
	padding: 15upx 0;
	color: #CCCCCC !important;
	font-size: 25upx;
	background-color: #FFFFFF !important;
}

.common-list-r>view:nth-child(1)>view:nth-child(1)>view:first-child {
	color: #999999;
	font-size: 30upx;
}

.common-list-r>view:nth-child(1)>view:nth-child(1)>view:last-child {
	background: #EEEEEE;
	padding: 0 10upx;
	font-size: 26upx;
}

</style>
